package com.zues.enums;

public enum ProductCategoryEnum {
	SUCCESS(1,"创建成功"), INNER_ERROR(-1001, "内部系统错误");

	private int state;
	private String stateInfo;

	private ProductCategoryEnum(int state, String statseInfo) {
		this.state = state;
		this.stateInfo = statseInfo;
	}

	/**
	 * 依据传入的state返回相应的enum值
	 */
	public static ProductCategoryEnum stateOf(int state){
		for(ProductCategoryEnum stateEnum : values()){
			if(stateEnum.getState() == state){
				return stateEnum;
			}
		}
		return null;
	}

	public int getState() {
		return state;
	}

	public String getStateInfo() {
		return stateInfo;
	}
}
